local WzqProto = require "modules.wzq.WzqProto"

local M = {}

local function callGame(player, funcName, data)
    local room = player.room
    if not room then
        return
    end

    local result = room[funcName](room, player.id, data)
    return result
end

for protoName in pairs(WzqProto) do
    local funcName = "CS_" .. protoName
    M[funcName] = function(player, data)
        return callGame(player, funcName, data)
    end
end

return M